import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import './nprogress'
// ElementUI
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/element-variables.scss'
Vue.use(ElementUI, {
    size: 'medium'
})
// web设置
import setTing from './appSetting'
Vue.prototype.$setTing = setTing
import VueWechatTitle from 'vue-wechat-title'
Vue.use(VueWechatTitle)
// 页面标题
import pageTitle from './components/pageTitle.vue'
Vue.component('pageTitle', pageTitle)
// 全局请求
import request from './utils/request'
Vue.prototype.$request = request
// 全局分页组件
import pagination from './components/pagination.vue'
Vue.component('pagination', pagination)

Vue.config.productionTip = false
// 验证用户权限
Vue.prototype.$isAdmin = (): boolean => {
    const permission = (JSON.parse((sessionStorage as any).getItem('loginMsg')) as any).permission
    // 权限（1：管理员，0：普通用户）
    return permission == '1' ? true : false
}
new Vue({
    router,
    store,
    render: (h) => h(App)
}).$mount('#app')
